home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DExtension.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  8.7 KB  |  304 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DExtension.p
  3.  
  4.      Contains:    QuickDraw 3D Plug-in Architecture     Interface File.                                
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DExtension;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DEXTENSION__}
  27. {$SETC __QD3DEXTENSION__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DExtensionIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __QD3DERRORS__}
  37. {$I QD3DErrors.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN POWER}
  43. {$LibExport+}
  44.  
  45. {*****************************************************************************
  46.  **                                                                             **
  47.  **                                Constants                                      **
  48.  **                                                                             **
  49.  ****************************************************************************}
  50. {$IFC TARGET_OS_MAC }
  51.  
  52. CONST
  53.     kQ3XExtensionMacCreatorType    = 'Q3XT';
  54.     kQ3XExtensionMacFileType    = 'shlb';
  55.  
  56. {$ENDC}  {TARGET_OS_MAC}
  57.  
  58.  
  59. {*****************************************************************************
  60.  **                                                                             **
  61.  **                                Object Method types                              **
  62.  **                                                                             **
  63.  ****************************************************************************}
  64.  
  65. CONST
  66.     kQ3XMethodTypeObjectClassVersion = 'vrsn';
  67.  
  68.  
  69. TYPE
  70.     TQ3XObjectClassVersion                = UInt32;
  71.  
  72. CONST
  73.     kQ3XMethodTypeObjectClassRegister = 'rgst';
  74.  
  75.  
  76. TYPE
  77. {$IFC TYPED_FUNCTION_POINTERS}
  78.     TQ3XObjectClassRegisterMethod = FUNCTION(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr): TQ3Status; C;
  79. {$ELSEC}
  80.     TQ3XObjectClassRegisterMethod = ProcPtr;
  81. {$ENDC}
  82.  
  83.  
  84. CONST
  85.     kQ3XMethodTypeObjectClassReplace = 'rgrp';
  86.  
  87.  
  88. TYPE
  89. {$IFC TYPED_FUNCTION_POINTERS}
  90.     TQ3XObjectClassReplaceMethod = PROCEDURE(oldObjectClass: TQ3XObjectClass; oldClassPrivate: UNIV Ptr; newObjectClass: TQ3XObjectClass; newClassPrivate: UNIV Ptr); C;
  91. {$ELSEC}
  92.     TQ3XObjectClassReplaceMethod = ProcPtr;
  93. {$ENDC}
  94.  
  95.  
  96. CONST
  97.     kQ3XMethodTypeObjectClassUnregister = 'unrg';
  98.  
  99.  
  100. TYPE
  101. {$IFC TYPED_FUNCTION_POINTERS}
  102.     TQ3XObjectClassUnregisterMethod = PROCEDURE(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr); C;
  103. {$ELSEC}
  104.     TQ3XObjectClassUnregisterMethod = ProcPtr;
  105. {$ENDC}
  106.  
  107.  
  108. CONST
  109.     kQ3XMethodTypeObjectNew        = 'newo';
  110.  
  111.  
  112. TYPE
  113. {$IFC TYPED_FUNCTION_POINTERS}
  114.     TQ3XObjectNewMethod = FUNCTION(object: TQ3Object; privateData: UNIV Ptr; parameters: UNIV Ptr): TQ3Status; C;
  115. {$ELSEC}
  116.     TQ3XObjectNewMethod = ProcPtr;
  117. {$ENDC}
  118.  
  119.  
  120. CONST
  121.     kQ3XMethodTypeObjectDelete    = 'dlte';
  122.  
  123.  
  124. TYPE
  125. {$IFC TYPED_FUNCTION_POINTERS}
  126.     TQ3XObjectDeleteMethod = PROCEDURE(object: TQ3Object; privateData: UNIV Ptr); C;
  127. {$ELSEC}
  128.     TQ3XObjectDeleteMethod = ProcPtr;
  129. {$ENDC}
  130.  
  131.  
  132. CONST
  133.     kQ3XMethodTypeObjectDuplicate = 'dupl';
  134.  
  135.  
  136. TYPE
  137. {$IFC TYPED_FUNCTION_POINTERS}
  138.     TQ3XObjectDuplicateMethod = FUNCTION(fromObject: TQ3Object; fromPrivateData: UNIV Ptr; toObject: TQ3Object; toPrivateData: UNIV Ptr): TQ3Status; C;
  139. {$ELSEC}
  140.     TQ3XObjectDuplicateMethod = ProcPtr;
  141. {$ENDC}
  142.  
  143. {$IFC TYPED_FUNCTION_POINTERS}
  144.     TQ3XSharedLibraryRegister = FUNCTION: TQ3Status; C;
  145. {$ELSEC}
  146.     TQ3XSharedLibraryRegister = ProcPtr;
  147. {$ENDC}
  148.  
  149. {*****************************************************************************
  150.  **                                                                             **
  151.  **                            Object Hierarchy Registration                      **
  152.  **                                                                             **
  153.  ****************************************************************************}
  154. {
  155.  *    Q3XObjectHierarchy_RegisterClass
  156.  *    
  157.  *    Register an object class in the QuickDraw 3D hierarchy.
  158.  *    
  159.  *    parentType            - an existing type in the hierarchy, or 0 to subclass
  160.  *                            TQ3Object
  161.  *    objectType            - the new object class type, used in the binary 
  162.  *                        metafile.  This is assigned at run time and returned
  163.  *                          to you.
  164.  *    objectName            - the new object name, used in the text metafile
  165.  *    metaHandler            - a TQ3XMetaHandler (may be NULL for some classes) 
  166.  *                          which returns non-virtual methods
  167.  *    virtualMetaHandler    - a TQ3XMetaHandler (may be NULL as well) which returns
  168.  *                            virtual methods a child would inherit
  169.  *    methodsSize            - the size of the class data needed (see 
  170.  *                            GetClassPrivate calls below)
  171.  *    instanceSize        - the size of the object instance data needed (see 
  172.  *                            GetPrivate calls below)
  173.  }
  174. FUNCTION Q3XObjectHierarchy_RegisterClass(parentType: TQ3ObjectType; VAR objectType: TQ3ObjectType; objectName: CStringPtr; metaHandler: TQ3XMetaHandler; virtualMetaHandler: TQ3XMetaHandler; methodsSize: UInt32; instanceSize: UInt32): TQ3XObjectClass; C;
  175. {
  176.  *    Q3XObjectHierarchy_UnregisterClass
  177.  *    
  178.  *    Returns kQ3Failure if the objectClass still has objects 
  179.  * around; the class remains registered.
  180.  }
  181. FUNCTION Q3XObjectHierarchy_UnregisterClass(objectClass: TQ3XObjectClass): TQ3Status; C;
  182. {
  183.  *    Q3XObjectHierarchy_GetMethod
  184.  *    
  185.  *    For use in TQ3XObjectClassRegisterMethod call
  186.  }
  187. FUNCTION Q3XObjectClass_GetMethod(objectClass: TQ3XObjectClass; methodType: TQ3XMethodType): TQ3XFunctionPointer; C;
  188. {
  189.  *    Q3XObjectHierarchy_NewObject
  190.  *    
  191.  *    To create a new object. Parameters is passed into the 
  192.  *    TQ3XObjectNewMethod as the "parameters" parameter.
  193.  }
  194. FUNCTION Q3XObjectHierarchy_NewObject(objectClass: TQ3XObjectClass; parameters: UNIV Ptr): TQ3Object; C;
  195. {
  196.  *    Q3XObjectClass_GetLeafType
  197.  *    
  198.  *    Return the leaf type of a class.
  199.  }
  200. FUNCTION Q3XObjectClass_GetLeafType(objectClass: TQ3XObjectClass): TQ3ObjectType; C;
  201. {
  202.  *    Q3XObjectClass_GetVersion
  203.  *    This routine obtains the the version of a class, referenced by an
  204.  *    object class type.  Functions for getting the type are in QD3D.h,
  205.  *    if you have the class name.
  206.  }
  207. FUNCTION Q3XObjectHierarchy_GetClassVersion(objectClassType: TQ3ObjectType; VAR version: TQ3XObjectClassVersion): TQ3Status; C;
  208. {
  209.  *    Q3XObjectClass_GetType 
  210.  *
  211.  *    This can be used to get the type, given a reference 
  212.  *    to a class.  This is most useful in the instance where you register a 
  213.  *    an element/attribute and need to get the type.  When you register an
  214.  *    element, QD3D will take the type you pass in and modify it (to avoid
  215.  *    namespace clashes).  Many object system calls require an object type
  216.  *    so this API call allows you to get the type from the class referernce
  217.  *    that you will ordinarily store when you register the class.
  218.  }
  219. FUNCTION Q3XObjectClass_GetType(objectClass: TQ3XObjectClass; VAR theType: TQ3ObjectType): TQ3Status; C;
  220.  
  221. FUNCTION Q3XObjectHierarchy_FindClassByType(theType: TQ3ObjectType): TQ3XObjectClass; C;
  222.  
  223.  
  224. {
  225.  *    Q3XObjectClass_GetPrivate
  226.  *    
  227.  *    Return a pointer to private instance data, a block of instanceSize bytes, 
  228.  *    from the Q3XObjectHierarchy_RegisterClass call.
  229.  *    
  230.  *    If instanceSize was zero, NULL is always returned.
  231.  }
  232. FUNCTION Q3XObjectClass_GetPrivate(objectClass: TQ3XObjectClass; targetObject: TQ3Object): Ptr; C;
  233. {
  234.  * Return the "TQ3XObjectClass" of an object
  235.  }
  236. FUNCTION Q3XObject_GetClass(object: TQ3Object): TQ3XObjectClass; C;
  237.  
  238.  
  239. {*****************************************************************************
  240.  **                                                                             **
  241.  **                    Shared Library Registration Entry Point                      **
  242.  **                                                                             **
  243.  ****************************************************************************}
  244.  
  245. TYPE
  246.     TQ3XSharedLibraryInfoPtr = ^TQ3XSharedLibraryInfo;
  247.     TQ3XSharedLibraryInfo = RECORD
  248.         registerFunction:        TQ3XSharedLibraryRegister;
  249.         sharedLibrary:            UInt32;
  250.     END;
  251.  
  252. FUNCTION Q3XSharedLibrary_Register(VAR sharedLibraryInfo: TQ3XSharedLibraryInfo): TQ3Status; C;
  253. FUNCTION Q3XSharedLibrary_Unregister(sharedLibrary: UInt32): TQ3Status; C;
  254.  
  255. {*****************************************************************************
  256.  **                                                                             **
  257.  **                                Posting Errors                                  **
  258.  **                                                                             **
  259.  **            You may only call these functions from within an extension         **
  260.  **                                                                             **
  261.  ****************************************************************************}
  262. {
  263.  *    Q3XError_Post
  264.  *    
  265.  *    Post a QuickDraw 3D Error from an extension.
  266.  }
  267. PROCEDURE Q3XError_Post(error: TQ3Error); C;
  268. {
  269.  *    Q3XWarning_Post
  270.  *    
  271.  *    Post a QuickDraw 3D Warning, from an extension.  Note the warning code you
  272.  *    pass into this routine must already be defined in the table above.
  273.  }
  274. PROCEDURE Q3XWarning_Post(warning: TQ3Warning); C;
  275. {
  276.  *    Q3XNotice_Post
  277.  *    
  278.  *    Post a QuickDraw 3D Notice, from an extension.  Note the notice code you
  279.  *    pass into this routine must already be defined in the table above.
  280.  }
  281. PROCEDURE Q3XNotice_Post(notice: TQ3Notice); C;
  282.  
  283. {$IFC TARGET_OS_MAC }
  284. {
  285.  *    Q3XMacintoshError_Post
  286.  *    
  287.  *    Post the QuickDraw 3D Error, kQ3ErrorMacintoshError, and the Macintosh
  288.  *    OSErr macOSErr. (Retrieved with Q3MacintoshError_Get)
  289.  }
  290. PROCEDURE Q3XMacintoshError_Post(macOSErr: OSErr); C;
  291. {$ENDC}  {TARGET_OS_MAC}
  292.  
  293.  
  294. {$ALIGN RESET}
  295. {$POP}
  296.  
  297. {$SETC UsingIncludes := QD3DExtensionIncludes}
  298.  
  299. {$ENDC} {__QD3DEXTENSION__}
  300.  
  301. {$IFC NOT UsingIncludes}
  302.  END.
  303. {$ENDC}
  304.